package org.javaboy.shiro;

import org.apache.shiro.authc.credential.DefaultPasswordService;
import org.apache.shiro.crypto.hash.DefaultHashService;
import org.apache.shiro.crypto.hash.SimpleHash;

public class PasswordEncoder02 {
    public static void main(String[] args) {
        //密码加密服务
        DefaultPasswordService passwordService = new DefaultPasswordService();
        DefaultHashService hs = new DefaultHashService();
        //使用 BCrypt 加密方案
        hs.setDefaultAlgorithmName("2y");
        passwordService.setHashService(hs);
        for (int i = 0; i < 10; i++) {
            String s = passwordService.encryptPassword("123");
            System.out.println("s = " + s);
        }
    }
}